{block name=product} {if $cnt}{assign var='cnt' value=$cnt+1}{else}{assign var='cnt' value=1}{/if}
<div class="col-sm-4 prods">
    <img class="img-responsive" src="{$item.gallery.0.gallery_link}" title="{$item.gallery.0.gallery_title}" alt="{$item.gallery.0.gallery_alt_tag}">
    <h4>{$item.product_name}</h4>
    <form class="form-horizontal product-forms" id="product-form{$cnt}" data-attr-id="product-form" role="form" accept-charset="UTF-8" action="" method="post">
        <input type="hidden" value="AddProductToCart" name="action" id="action" />
        <input type="hidden" name="formToken" id="formToken" value="{$token}" />
        <input type="hidden" value="{$item.product_object_id}" name="product_id" id="product_id" /> {foreach $item.attribute as $attr } {if $attr.attr_value}
        <div class="form-group">
            <label for="address_state_1" class="col-sm-2 control-label">{$attr.attribute_name}:</label>
            <div class="col-sm-6">
                <select id="{urlencode data=$attr.attribute_name}" name="attr[{$attr.attribute_id}]" class='form-control modifier required' onchange="calculatePrice('product-form{$cnt}')">
                    <option value="" price="0" instock="0" weight="0" width="0" height="0" length="0" name="">请选择
                    </option>
                    {foreach $attr.attr_value as $value }
                    <option value="{$value.attr_value_id}" price="{if $item.product_specialprice neq '0.00'}{$value.attr_value_specialprice}{else}{$value.attr_value_price}{/if}" instock="{$value.attr_value_instock}" weight="{$value.attr_value_weight}" width="{$value.attr_value_width}" height="{$value.attr_value_height}" length="{$value.attr_value_length}" name="{urlencode data=$value.attr_value_name}">{$value.attr_value_name}
                    </option>
                    {/foreach}
                </select>
            </div>
        </div>
        {/if} {/foreach}
        <div class="form-group">
            <div class="col-sm-12">
                {if $item.product_specialprice eq '0.00'}
                <div style="display:inline;">价格: {$CURRENCY_SYMBOL}</div>
                <div style="display:inline;" class="cal-price" value="{$item.product_price}">{$item.product_price|number_format:2:'.':','}</div>
                <div style="display:inline;">
                    <input type="hidden" value="{$item.product_price}" name="price" class="price" />
                </div>
                {else}
                <div style="display:inline;text-decoration: line-through;">价格: {$CURRENCY_SYMBOL}</div>
                <div style="display:inline;text-decoration: line-through;">{$item.product_price|number_format:2:'.':','}</div>
                <br />
                <div style="display:inline;color:#FF4822">特价: {$CURRENCY_SYMBOL}</div>
                <div style="display:inline;color:#FF4822" class="cal-price" value="{$item.product_specialprice}">{$item.product_specialprice|number_format:2:'.':','}</div>
                <div style="display:inline;">
                    <input type="hidden" value="{$item.product_specialprice}" name="price" class="price" />
                </div>
                {/if}
            </div>
        </div>
        {if $item.product_instock}
        <div class="form-group">
            <label for="address_state_1" class="col-sm-2 control-label">数量: </label>
            <div class="col-sm-4">
                <select name="quantity" id="quantity" class="form-control">
                    {for $qty=1 to 12}
                    <option value="{$qty}">{$qty}</option>
                    {/for}
                </select>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-10">
                <button type="submit" class="btn-default btn">放入购物车</button>
                <div style="display:inline;color:#ff0000" id="error-text"></div>
            </div>
        </div>
        {else}
        <div class="form-group">
            <div style="display:inline;color:#ff0000">缺货</div>
        </div>
        {/if}
    </form>
</div>
{/block}
